import React, { Component } from 'react';
import './style.css'
import classnames from 'classnames'
class CssStyle extends Component {
    //状态 样式
    state = {
        show: false
    }
    render() {
        return (
            <div className="CssStyle">
                <h1>动态class-数组方式</h1>
                <div className="classB">颜色？</div>
                <div className={[this.state.show ? 'classA' : 'classC classD', 'classB'].join('')}>颜色？</div>
                <div className={classnames('classA', 'classB')}>classnames-动态class</div>
                <div className={classnames({ show: true })}>classnames-动态class</div>
                <div className={classnames('a', ['a1', 'ab'])}>classnames-动态class</div>
            </div>
        )
    }
}